package com.qiyue.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qiyue.pojo.Myfile;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface MyFileMapper extends BaseMapper<Myfile> {
    /**
     * 根据uuid搜索文件类型
     * @param uuid
     * @return
     */
    @Select("select f.filetype from tb_file_server f where f.uuid = #{uuid}")
    String findFileType(@Param("uuid") String uuid);

    /**
     * 搜索元数据
     * @param uuid
     * @return
     */
    @Select("select * from tb_file_server where uuid = #{uuid}")
    Map<String, Object> findByUUID(@Param("uuid") String uuid);
}
